<template>
	<view class="zong_box">
		<view >
			<view class="con_box" v-for="(item, index) in list" :key="index" @click="toItem(item.id)">
				<view class="tirt">{{item.name}}</view>
				<view class="con_cont">
					<view class="dian"></view>
					<view>{{item.time_text}}</view>
				</view>
				<view class="con_cont">
					<view class="dian"></view>
					<view>{{item.hongbao_text}}</view>
				</view>
			
				<view class="line"></view>
				<view class="con_bottom">
					<view style="margin-right: 30px;">领取人数：{{item.lingqu_num}}</view>
					<view>消耗人数：{{item.xiaohao_num}}</view>
				</view>
			</view>
		</view>
		
		<view class="add" >
			<u-button type="error" shape="circle" @click="add()">添加米包</u-button>
		</view>
	</view>
</template>

<script>

	export default {
		data() {
			return {
				list:[],
			}
			},
		onShow() {
			this.list = [];
			this.getList();
		},
		methods: {
			// 获取列表
			getList() {
				let that = this;
				that.$http_business('store.couponList').then(res => {
					if (res.code == 1) {
						that.list = res.data;
						console.log("that.list:",that.list)
					}
				});
			},

			// 路由跳转
			jump(path, parmas) {
				this.$Router.push({
					path: path,
					query: parmas
				});
			},

		
			toItem(id) {
				uni.navigateTo({
					url: 'pages/youhui/shuyouhui?id='+id
				});
			},
			add() {
				this.jump('/pages/youhui/add');

			}
		}
	}
	
</script>

<style lang="scss" scoped>
	.zong_box {
		padding: 24rpx;
		padding-bottom: 120rpx;
	}

	.line {
		margin: 10px auto;
		width: 100%;
		height: 1px;
		border-bottom: 1px solid #E7E7E7;		
	}

	.con_box {
		width: 702rpx;
		height: 308rpx;
		background: #FFFFFF;
		box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.0500);
		border-radius: 8px;
		padding: 30rpx;
		margin-bottom: 20rpx;
	}

	.tirt {
		font-size: 30rpx;
		font-family: PingFangSC-Medium, PingFang SC;
		font-weight: 500;
		color: #222222;
	}

	.con_cont {
		display: flex;
		align-items: center;
		margin-top: 24rpx;
		font-size: 26rpx;
	}

	.dian {
		width: 8rpx;
		height: 8rpx;
		background-color: red;
		border-radius: 50%;
		margin-right: 14rpx;
	}

	.con_bottom {
		// margin-top: 56rpx;
		font-size: 26rpx;
		display: flex;
	}

	.add {
		padding: 30rpx;
		background-color: #FFFFFF;
		position: fixed;
		width: 100%;
		bottom: 0;
		left: 0;
	}
</style>
